<template>
	<div class="">
		<el-scrollbar class="app-container-scroll-bar">
			
			<listTpml :data="pageData"  @handleSearchLog="handleSearchLog" ref="listTpml"></listTpml>
      
			<pageLog
			style="height:500px;margin:20px 20px 0;border-radius:5px;"
			:options="pageLogOptions"
			ref="pageLog"
			></pageLog>
						
    </el-scrollbar>
		
		
	</div>
</template>

<script>
import listTpml from "@/view/components/listTmpl"
import { searchBussinessInfoPage } from '@/service/swagger/LogController.js'
import pageLog from '@/view/components/log/pageLog.vue';

export default {
	components: {
		listTpml,pageLog
	},
	data() {
		return {
			logList: [],
			showloading: false,
			busy: true,
			pageNum: 0,
			pageSize: 100,
			totalPage: 0,
			params: {},
			url: '/appcloud-log-es/appcloudes/searchBussinessInfoPage',//获取日志
			pageData: {
				pageTitle: "应用日志",
				filterOption: [
					{
						label: "模板选择", // label名
						tmpurl: '/appcloud-data/api/template/getTemplate4Log',//获取模板
						insturl: '/appcloud-data/api/appInst/getAppInstList',//获取实例
						paramsName: "logId", // 出参name值
						defaultValue: "", // 出参默认值
						componentsName: "searchSelect" // 组件名
					},

					{
						label: "开始时间", // label名
						paramsName: "createTimeStart", // 出参name值
						defaultValue: "", // 出参默认值
						componentsName: "startDate" // 组件名
					},
					{
						label: "结束时间", // label名
						paramsName: "createTimeEnd", // 出参name值
						defaultValue: "", // 出参默认值
						componentsName: "endDate" // 组件名
					},
					{
						label: "关 键 词", // label名
						paramsName: "keyWord", // 出参name值
						defaultValue: "", // 出参默认值
						componentsName: "hostNameInput" // 组件名
					},
				]
			},
			pageLogOptions:{
				autoGetData : false ,
				serviceFN : searchBussinessInfoPage,
				params : {}
			}
		}
	},
	methods: {
	    handleSearchLog(params){
				console.log(params)
				this.$refs.pageLog.initPage()
        if(params&&params.logId){
					this.pageLogOptions.params = {...params}
          this.$refs.pageLog.initData()					
				}else{
					return false
				}
			}
	}
}
</script>

<style>
</style>